//
//  TableViewController.m
//  News
//
//  Created by Justsoso on 16/3/7.
//  Copyright © 2016年 Justsoso. All rights reserved.
//

#import "TableViewController.h"
#import "TableViewCell.h"

@interface TableViewController ()
@property (nonatomic,strong) NSArray *list;
@end

@implementation TableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSString *path = [[NSBundle mainBundle] pathForResource:@"11215" ofType:@"plist"];
    self.list = [NSArray arrayWithContentsOfFile:path];
}


#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.list.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    NSDictionary *d = self.list[indexPath.row];
    // Configure the cell...
    
    TableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
    cell.imagesView.image = [UIImage imageNamed:d[@"image"]];
    cell.titleLabel.text = d[@"title"];
    cell.dateLabel.text = d[@"date"];
    cell.textsLabel.text = d[@"Text"];
    
    return cell;
}


@end
